package com.leung.publisher;


import com.leung.domain.entity.DeviceConfig;
import com.leung.domain.messageEntity.MqMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author 丨一
 * @version 1.0
 * @title MessagePublisher
 * @description:
 * @date 2025/3/6 下午2:20
 */
@Slf4j
@Component
public class MessagePublisher {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send2TcpWebService(MqMessage<DeviceConfig> deviceConfig) {
        String exchangeName = "tcpweb.direct";
        String routingKey = "tcpWeb";
        log
        rabbitTemplate.convertAndSend(exchangeName, routingKey, deviceConfig);
    }
    
}
